package com.igoal.service;

import org.springframework.transaction.annotation.Transactional;

import com.igoal.dto.BaseCommentDTO;
import com.igoal.dto.CommentEntryDTO;
import com.igoal.dto.UserDTO;
import com.igoal.entity.ICommentEntry;
import com.igoal.entity.Entry;

public interface CommentEntryService<E extends Entry, C extends ICommentEntry<E>, D extends BaseCommentDTO<E, C>>
		extends GenericManager<D, Long> {
	/**
	 * Add a comment by user
	 * 
	 * @param dto
	 *            the model of comment {@link CommentEntryDTO}
	 * @param user
	 *            the model of user {@link UserDTO}
	 * @return {@link SaveResult}
	 */
	@Transactional(readOnly = false)
	D addCommentToGoalEntry(D dto, UserDTO user);

	/**
	 * Update the comment by user session
	 * 
	 * @param dto
	 *            the model of comment {@link CommentEntryDTO}
	 * @return {@link SaveResult}
	 */
	@Transactional(readOnly = false)
	int updateCommentOfGoalEntry(D dto);

	/**
	 * Delete comment
	 * 
	 * @param dto
	 * @param whoDelete
	 * @return
	 */
	int deleteCommentOfGoalEntry(D dto, UserDTO whoDelete);
}
